<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>v_hdmirxss: hmac.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">v_hdmirxss
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('hmac_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">hmac.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains the implementation of the HMAC Hash Message Authentication Code. </p>
<pre>
 MODIFICATION HISTORY:</pre><pre> Ver   Who  Date     Changes
</p>
<hr/>
<p>
 1.00  MH   10/30/15 First Release
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a7e07dab5a5c98bb6dc90b13e6c5392d7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hmac_8c.html#a7e07dab5a5c98bb6dc90b13e6c5392d7">SHA256_SIZE</a>&#160;&#160;&#160;256/8</td></tr>
<tr class="memdesc:a7e07dab5a5c98bb6dc90b13e6c5392d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">SHA256 Hash size.  <a href="#a7e07dab5a5c98bb6dc90b13e6c5392d7">More...</a><br/></td></tr>
<tr class="separator:a7e07dab5a5c98bb6dc90b13e6c5392d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a71ef3e6e62d58ef753a01bdb118b04c3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hmac_8c.html#a71ef3e6e62d58ef753a01bdb118b04c3">XHdcp22Cmn_HmacSha256Hash</a> (const u8 *Data, int DataSize, const u8 *Key, int KeySize, u8 *HashedData)</td></tr>
<tr class="memdesc:a71ef3e6e62d58ef753a01bdb118b04c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function does a HMAC_SHA256 transform: SHA256(K XOR opad, SHA256(K XOR ipad, text))  <a href="#a71ef3e6e62d58ef753a01bdb118b04c3">More...</a><br/></td></tr>
<tr class="separator:a71ef3e6e62d58ef753a01bdb118b04c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a7e07dab5a5c98bb6dc90b13e6c5392d7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SHA256_SIZE&#160;&#160;&#160;256/8</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>SHA256 Hash size. </p>

<p>Referenced by <a class="el" href="xhdcp22__common_8h.html#a71ef3e6e62d58ef753a01bdb118b04c3">XHdcp22Cmn_HmacSha256Hash()</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a71ef3e6e62d58ef753a01bdb118b04c3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XHdcp22Cmn_HmacSha256Hash </td>
          <td>(</td>
          <td class="paramtype">const u8 *&#160;</td>
          <td class="paramname"><em>Data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>DataSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u8 *&#160;</td>
          <td class="paramname"><em>Key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>KeySize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>HashedData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function does a HMAC_SHA256 transform: SHA256(K XOR opad, SHA256(K XOR ipad, text)) </p>
<p>ipad is the byte 0x36 repeated 64 times opad is the byte 0x5c repeated 64 times and text is the data being protected</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Data</td><td>is the input data. </td></tr>
    <tr><td class="paramname">DataSize</td><td>is the size of the data buffer. </td></tr>
    <tr><td class="paramname">Key</td><td>is the hash-key to use. </td></tr>
    <tr><td class="paramname">KeySize</td><td>is the size of the hash key. </td></tr>
    <tr><td class="paramname">HashedData</td><td>is the output of this function.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS if no errors occured<ul>
<li>XST_FAILURE if the datasize execeeds the size of the local buffer.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="hmac_8c.html#a7e07dab5a5c98bb6dc90b13e6c5392d7">SHA256_SIZE</a>, and <a class="el" href="sha2_8c.html#a133c201a02c4a4be6e7d38bb450fa31e">XHdcp22Cmn_Sha256Hash()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
